import { Component, OnInit } from '@angular/core';
import {Hero} from '../heroes/class/hero'
import {HeroService} from '../hero.service'
@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {
  heroes:Hero[]=[];
  constructor(private helloService:HeroService) { }

  ngOnInit() {
    this.getHeroes();
  }
  getHeroes():void{
    this.helloService.getHeros().subscribe(heroes=>this.heroes=heroes.slice(1,5));
  }

}
